package com.xhj.myframe.myspring.annotation;
/**
 * -
 *
 * @author 见见 pure_xhj@163.com @Date 2021-08-22 @Time 12:08
 */
public class Test {
  public static void main(String[] args) {
    Teacher teacher = new Teacher();
    Book book = new Book();

    System.out.println(teacher.toString());
    System.out.println(book.toString());
    System.out.println("==================================================");

    MyAnnotationUtil.wright(teacher);
    MyAnnotationUtil.wright(book);
    System.out.println(teacher.toString());
    System.out.println(book.toString());

    System.out.println("==================================================");
    Manage manage = new Manage();
    MyAnnotationUtil.autowire(manage);
    System.out.println(manage.toString());
  }
  /**
   * -
   *
   * @author 见见 pure_xhj@163.com @Date 2021-08-22 @Time 12:06
   */
  public static class Book {
    @Name("深入理解JVM")
    String book;

    public Book() {}

    @Override
    public String toString() {
      return "Book{" + "book='" + book + '\'' + '}';
    }
  }
  /**
   * -
   *
   * @author 见见 pure_xhj@163.com @Date 2021-08-22 @Time 12:41
   */
  public static class Manage {
    @MyAutowire Teacher teacher;
    @MyAutowire Book book;

    @Override
    public String toString() {
      return "Manage{" + "teacher=" + teacher + ", book=" + book + '}';
    }
  }
  /**
   * -
   *
   * @author 见见 pure_xhj@163.com @Date 2021-08-22 @Time 12:04
   */
  public static class Teacher {
    @Name("张三")
    String name;

    @Override
    public String toString() {
      return "Teacher{" + "name='" + name + '\'' + '}';
    }
  }
}
